
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>

</title>
<script type="text/javascript" src="__ROOT__/js/jquery.js"></script>
<script type="text/javascript">
	$(document).ready(function () {
		$("#btnSearchShow").click(function () {
			$("#btnSearch").click();
		});
	});



function doArticle(id){
	
	if(confirm('确定要处理吗'))
	{
		$.ajax({  
					type: "post",  
					url: "ajaxContact_do",  
					dataType: 'json',
					data: {'id':id},
					beforeSend: function(XMLHttpRequest){   
					},  
					error:function(){
						alert('error delArticle');
					},
					async : false,
					success: function(json)
					{
						
						if(json.data == 1){
							alert(json.info);
						} else
						{
							alert('已经处理!');
						}
					} 
				})
	}else
	{
		return false;
	}
	
}	

function delArticle(id){
    
    if(confirm('确定要删除吗'))
    {
        $.ajax({  
                    type: "post",  
                    url: "ajaxContact_del",  
                    dataType: 'json',
                    data: {'id':id},
                    beforeSend: function(XMLHttpRequest){   
                    },  
                    error:function(){
                        alert('error delArticle');
                    },
                    async : false,
                    success: function(json)
                    {
                        
                        if(json.data == 1){
                            alert(json.info);
                        } else
                        {
                            alert('wrong3!');
                        }
                    } 
                })
    }else
    {
        return false;
    }
    
}   	
</script>
</head>
<body>

<script type="text/javascript">
//<![CDATA[
var theForm = document.forms['form1'];
if (!theForm) {
    theForm = document.form1;
}
function __doPostBack(eventTarget, eventArgument) {
    if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
        theForm.__EVENTTARGET.value = eventTarget;
        theForm.__EVENTARGUMENT.value = eventArgument;
        theForm.submit();
    }
}
//]]>
</script>

  <!--顶部+导航开始-->
<include file="./top" />
  <!--顶部+导航结束-->
    
    
    <!--内容开始-->
    <div id="content">
        <!--项目大标题-->
        <div id="content-header">
            <h1>
                联系我们</h1>
        </div>
        <!--主体内容区域开始-->
        <div id="content-container">
            <div class="row">

                <!--主体内容开始-->
                <div class="col-md-12">
                    <div class="dataTables_wrapper" role="grid">
    <!--查询表单开始-->
    <form method="post" action="__ACTION__">
                        <div style="width: 98%; margin: auto; display: block; padding: 15px 35px 10px 20px;"
                            class="row dt-rt pricing-plan promoted">
                            <div class="col-sm-12 form-group">
                                <div class="col-md-3" style="padding-left: 0;">
                                    <label class="col-md-3" style="padding: 0">
                                        关键词</label>
                                    <div class="col-md-8">
                                        <input name="txtTitle" type="text" id="txtTitle" placeholder="查询主题" class="form-control" />
                                    </div>
                                </div>

                                <div class="col-md-1 text-right" style="padding-right: 0">
                                    <button type="button" class="btn btn-primary" id="btnSearchShow">
                                        <i class="glyphicon glyphicon-search"></i> 查 询</button>
                                        
                                </div>
                                <div style="display: none">
                                    <input type="submit" name="btnSearch" value="" id="btnSearch" />
                                </div>
                                
                                <label class="col-md-3" style="padding: 0 30px">
                                       状态：1-正常，2-已处理</label>
                            </div>
                        </div>
                        </form>
                        <!--查询表单结束-->
                     
                        <!--列表开始-->
                        
                                <table class="table table-bordered table-highlight table-striped table-hover">
                                    <tr>
                                        <th width="70">
                                           ID
                                        </th>
                                        <th width="120">
                                            EMAIL
                                        </th>
                                        <th width="120">
                                            手机
                                        </th>
                                        <th>
                                            内容
                                        </th>
                                        <th width="100">
                                          用户
                                        </th>
                                        <th width="80">
                                           添加时间
                                        </th>

                                        <th width="40">
                                            状态
                                        </th>
                                        <th width="100">
                                            管理
                                        </th>
                                    </tr>
                                    
		<?php foreach ($data as $k => $v):?>
		<tr>
			<td><?php echo $v['id'];?></td>
			<td><?php echo $v['email'];?></td>
			<td><?php echo $v['mobile'];?></td>
			<td><?php echo $v['content'];?></td>
			<td><?php echo $v['name'];?></td>
            <td><?php echo $v['addtime'];?></td>
            <td><?php echo $v['flag'];?></td>
			<td>
			
			<?php if ($v['flag'] != 2){?><a onClick="doArticle(<?php echo $v['id'];?>);" href="">处理</a><?php }?>
			
			<a onClick="delArticle(<?php echo $v['id'];?>);" href="">删除</a>
			</td>
			
		</tr>
		<?php endforeach;?>

                                </table>
                            
                        <!--列表结束-->
                        <!--条目统计/翻页开始-->
                        <div class="row">
                            <div class="col-sm-12">
                                <div class="dataTables_paginate paging_bootstrap">
                                    <!--分页开始-->
                                    <?php echo $pagestr;?>
                                    <!--分页结束-->
                                </div>
                            </div>
                        </div>
                        <!--条目统计/翻页结束-->
                    </div>
                </div>
                <!--主体内容结束-->
            </div>
        </div>
        <!--主体内容区域结束-->
    </div>
    <!--内容结束-->
    <!--底部信息开始-->
<include file="./foot" />


    <!--底部信息结束-->
    </form>
</body>
</html>
